import request from "@/utils/request";

// 查询设计师信息列表
export function listDesigner(query) {
  return request({
    url: "/decor/designer/list",
    method: "get",
    params: query,
  });
}

// 查询设计师信息详细
export function getDesigner(designerId) {
  return request({
    url: "/decor/designer/" + designerId,
    method: "get",
  });
}

// 新增设计师信息
export function addDesigner(data) {
  return request({
    url: "/decor/designer",
    method: "post",
    data: data,
  });
}

// 修改设计师信息
export function updateDesigner(data) {
  return request({
    url: "/decor/designer",
    method: "put",
    data: data,
  });
}

// 删除设计师信息
export function delDesigner(designerId) {
  return request({
    url: "/decor/designer/" + designerId,
    method: "delete",
  });
}
// 根据id查询头像的url  GET
export function getImgUrl(ossIds) {
  return request({
    url: "/resource/oss/listByIds/" + ossIds,
    method: "get",
  });
}

// 机构下拉框数据
export function getInstitutionSelList() {
  return request({
    url: "/decor/organization/public/list",
    method: "get",
  });
}
// 设计师名称下拉框
export function getDesignerNameSel(query) {
  return request({
    url: "/system/user/miniUser",
    method: "get",
    params: query,
  });
}
// 职位下拉框
export function getPositionSelList() {
  return request({
    url: "/decor/position/public/list",
    method: "get",
  });
}
// 设计师认证新增
export function addAuthentication(data) {
  return request({
    url: "/decor/platform/designer",
    method: "post",
    data: data,
  });
}
// 设计师认证获取信息
export function getAuthentication() {
  return request({
    url: "/decor/platform/designer",
    method: "get",
  });
}
// 设计师认证修改
export function updateAuthentication(data) {
  return request({
    url: "/decor/platform/designer",
    method: "put",
    data: data,
  });
}
// 平台管理
// 设计师作品管理
// 查询设计师作品列表
export function getPlatformWorkList(data) {
  return request({
    url: "/decor/platform/designer/public/list",
    method: "get",
    params: data,
  });
}
// 获取作品总数
export function getPlatformWorkListTotal(designerId) {
  return request({
    url: "/decor/platform/designer/scheme/count/" + designerId,
    method: "get",
  });
}
// 删除
export function delPlatformWork(schemeId) {
  return request({
    url: "/decor/platform/designer/deleteScheme?schemeId=" + schemeId,
    method: "delete",
  });
}
// 详情
export function getPlatformWorkDetail(schemeId) {
  return request({
    url: "/decor/platform/designer/public/" + schemeId,
    method: "get",
  });
}
// 修改
export function editPlatformWork(data) {
  return request({
    url: "/decor/platform/designer/updateScheme",
    method: "put",
    data: data,
  });
}
